package com.example.myapplication.databinding;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.myapplication.databinding.bean.vegetable.ObservableVegetable;

/**
 * Created by xiaolong on 2022/1/4 6:13 下午
 * email：xinxiaolong123@foxmail.com
 */
public class BindAdapterActivity extends AppCompatActivity {

    ActivityBindadapterLayoutBinding binding;
    private ObservableVegetable obVegetable = new ObservableVegetable();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityBindadapterLayoutBinding.inflate(getLayoutInflater());
        binding.setLifecycleOwner(this);

        setContentView(binding.getRoot());

        initData();
    }


    private void initData() {
        obVegetable.setName("土豆");
        obVegetable.setColor("黄色");
        obVegetable.setPrice(2.5);
        binding.setObVegetavle(obVegetable);


    }

}
